INKEY$ Function ---------------------------------------------------------------------------- Action Returns a character from the keyboard or some other standard input device. Syntax INKEY$ Remarks The INKEY$ function returns a 1- or 2-byte string that contains a character read from the standard input device, which usually is the keyboard. A null string is returned if there is no character to return. A one-character string contains the actual character read from the standard input device, while a two-character string indicates an extended code, the first character of which is hexadecimal 00. For a complete list of these codes, see Appendix A, "Keyboard Scan Codes and ASCII Character Codes." The character returned by the INKEY$ function is never displayed on the screen; instead, all characters are passed through to the program except for these key combinations. ----------------------------------------------------------------------------- Character Running under QBX Stand-alone .EXE file ---------------------------------------------------------------------------- Ctrl+Break Halts program execution. Halts program execution if compiled with the -D option; otherwise, passed through to program., Ctrl+NumLock Causes program execution to Same as running under QBX if pause until a key is pressed; compiled with the -D option; Character Running under QBX Stand-alone .EXE file ---------------------------------------------------------------------------- pause until a key is pressed; compiled with the -D option; then the next key pressed is otherwise, it is ignored (the passed through to the program. program does not pause and no keystroke is passed). Shift+PrtSc Prints the screen contents. Prints the screen contents. Ctrl+Alt+Del Reboots the system. Reboots the system. If you have assigned a string to a function key using the KEY statement and you press that function key when INKEY$ is waiting for a keystroke, INKEY$ passes the string to the program. Enabled keystroke trapping takes precedence over the INKEY$ function. When you use INKEY$ with ISAM programs, BASIC performs implicit CHECKPOINT operations to minimize data loss in the event of a power failure. The CHECKPOINT is performed if INKEY$ fails to successfully retrieve a character after 65,535 calls, and 20 seconds has expired. A CHECKPOINT writes open database buffers to disk. Example The following example shows a common use of INKEY$. The program pauses until the user presses a key. PRINT "Press any key to continue..." DO LOOP WHILE INKEY$=""